#!/usr/bin/Python
#! -*- coding：utf-8 -*-

#统计指定目录大小

import os

def ReadSize(f1):
	global Sum
	flist = os.listdir(f1)
	for i in flist:
		file = os.path.join(f1,i)
		if os.path.isfile(file):
			Sum = Sum + os.path.getsize(file)
		if os.path.isdir(file):
			ReadSize(file)
	return Sum



#test
Sum = 0
aa = ReadSize('./file')
print(aa)
